var fruits = [
    {
        fruitName: '苹果',
        fruitQuantity: 30,
        fruitPrice: 3.8
    },
    {
        fruitName: '西瓜',
        fruitQuantity: 240,
        fruitPrice: 1.8
    },
    {
        fruitName: '芒果',
        fruitQuantity: 60,
        fruitPrice: 7.8
    }
]
// let total=fruits.reduce((total,item)=>{
//     return total=total+item.fruitQuantity*item.fruitPrice
// },0)
let total=fruits.reduce((total,item)=>total=total+item.fruitQuantity*item.fruitPrice,0)
console.log(total);